#include <cppunit/config/SourcePrefix.h>
#include "QueryPreProcessor_QueryEvaluatorTest.h"
#include <iostream>
#include <string>

using namespace std;

void
QueryPreProcessor_QueryEvaluatorTest::setUp()
{}
void
QueryPreProcessor_QueryEvaluatorTest::tearDown()
{}

CPPUNIT_TEST_SUITE_REGISTRATION( QueryPreProcessor_QueryEvaluatorTest );

void QueryPreProcessor_QueryEvaluatorTest::testQueryPreProcessor_QueryEvaluator(){
	PKB* testPKB = new PKB();
	QueryPreProcessor* qpp = new QueryPreProcessor(testPKB);
	QueryEvaluator* qe = new QueryEvaluator(testPKB);
	
	cout << "Testing : QueryPreProcessor to Query Evaluator" << endl;

	// verify that result of query is correct
	/*string query = "assign a; Select a such that Parent(1, a)";
	vector<vector<string>> parsed = qpp->processQuery(query);
	CPPUNIT_ASSERT(parsed.at(0).at(0) == "a");
	CPPUNIT_ASSERT(parsed.at(0).at(1) == "assign");
	CPPUNIT_ASSERT(parsed.at(1).at(0) == "Parent");
	CPPUNIT_ASSERT(parsed.at(1).at(1) == "1");
	CPPUNIT_ASSERT(parsed.at(1).at(2) == "a");
	CPPUNIT_ASSERT(parsed.at(1).at(3) == "integer");
	CPPUNIT_ASSERT(parsed.at(1).at(4) == "syn");
	CPPUNIT_ASSERT(parsed.at(1).at(5) == "NULL");
	CPPUNIT_ASSERT(parsed.at(1).at(6) == "assign");

	//insert new Parent relationship into PKB
	//testPKB->ast->setParentParent(1, 1); 

	//need to insert something into PKB to answer the query
	vector<string> final = qe->evaluate(parsed);
	//Testing Query Evaluation process
	CPPUNIT_ASSERT(final.empty());
	*/
	cout << "Test OK: QueryPreProcessor to Query Evaluator" << endl;
}